package com.zhengshang.api.service.impl;

import com.zhengshang.api.domain.AppPhoneArea;
import com.zhengshang.api.mapper.AppPhoneAreaMapper;
import com.zhengshang.api.service.IAppPhoneAreaService;
import com.zhengshang.common.utils.DateUtils;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 【请填写功能名称】Service业务层处理
 *
 * @author zhengshang
 * @date 2022-04-13
 */
@Service
public class AppPhoneAreaServiceImpl implements IAppPhoneAreaService {
    @Autowired
    private AppPhoneAreaMapper appPhoneAreaMapper;

    /**
     * 查询【请填写功能名称】
     *
     * @param phoneAreaId 【请填写功能名称】ID
     * @return 【请填写功能名称】
     */
    @Override
    public AppPhoneArea selectAppPhoneAreaById(Long phoneAreaId) {
        return appPhoneAreaMapper.selectAppPhoneAreaById(phoneAreaId);
    }

    /**
     * 查询【请填写功能名称】列表
     *
     * @param appPhoneArea 【请填写功能名称】
     * @return 【请填写功能名称】
     */
    @Override
    public List<AppPhoneArea> selectAppPhoneAreaList(AppPhoneArea appPhoneArea) {
        return appPhoneAreaMapper.selectAppPhoneAreaList(appPhoneArea);
    }

    /**
     * 新增【请填写功能名称】
     *
     * @param appPhoneArea 【请填写功能名称】
     * @return 结果
     */
    @Override
    public int insertAppPhoneArea(AppPhoneArea appPhoneArea) {
        appPhoneArea.setCreateTime(DateUtils.getNowDate());
        return appPhoneAreaMapper.insertAppPhoneArea(appPhoneArea);
    }

    /**
     * 修改【请填写功能名称】
     *
     * @param appPhoneArea 【请填写功能名称】
     * @return 结果
     */
    @Override
    public int updateAppPhoneArea(AppPhoneArea appPhoneArea) {
        appPhoneArea.setUpdateTime(DateUtils.getNowDate());
        return appPhoneAreaMapper.updateAppPhoneArea(appPhoneArea);
    }

    /**
     * 批量删除【请填写功能名称】
     *
     * @param phoneAreaIds 需要删除的【请填写功能名称】ID
     * @return 结果
     */
    @Override
    public int deleteAppPhoneAreaByIds(Long[] phoneAreaIds) {
        return appPhoneAreaMapper.deleteAppPhoneAreaByIds(phoneAreaIds);
    }

    /**
     * 删除【请填写功能名称】信息
     *
     * @param phoneAreaId 【请填写功能名称】ID
     * @return 结果
     */
    @Override
    public int deleteAppPhoneAreaById(Long phoneAreaId) {
        return appPhoneAreaMapper.deleteAppPhoneAreaById(phoneAreaId);
    }

    @Override
    public int countByPhone(@Param("phone") String phone) {
        return appPhoneAreaMapper.countByPhone(phone);
    }

    @Override
    public AppPhoneArea queryByPhone(@Param("phone") String phone) {
        return appPhoneAreaMapper.queryByPhone(phone);
    }
}
